package com.macro.mall.tiny.security.util;

import com.macro.mall.tiny.modules.ums.model.UmsAdmin;
import com.macro.mall.tiny.modules.ums.model.UmsMember;

/**
 * @author Tyrone
 * @date 2024/10/15 00:22
 */
public class AdminContext {

    private static ThreadLocal<UmsAdmin> holder = new ThreadLocal<>();

    public void parseToken(String token) {
        // parse token
        // setAdmin(admin);
    }

    public static ThreadLocal<UmsAdmin> getHolder() {
        return holder;
    }

    public static void setHolder(ThreadLocal<UmsAdmin> holder) {
        AdminContext.holder = holder;
    }

    public static void clear() {
        holder.remove();
    }
}
